package cn.cs.service;

import cn.cs.mapper.AgentManageMapper;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class AgentManageService {
    @Resource
    private AgentManageMapper agentManageMapper;

    @RequestMapping(value = "/getAgentLevelBs", method = RequestMethod.POST)
    List<Map<String,Object>> getAgentLevelBs(@RequestBody Map<String, Object> param){
        return agentManageMapper.getAgentLevelBs(param);
    }

    @RequestMapping(value = "/getLevelBCount", method = RequestMethod.POST)
    Map<String,Object> getLevelBCount(@RequestBody Map<String, Object> map){
        return agentManageMapper.getLevelBCount(map);
    }

    @RequestMapping(value = "/insertLevelB", method = RequestMethod.POST)
    int insertLevelB(@RequestBody Map<String, Object> param){
        return agentManageMapper.insertLevelB(param);
    }
    @RequestMapping(value = "/insertAgentArea", method = RequestMethod.POST)
    int insertAgentArea(@RequestBody Map<String, Object> areaMap){
        return agentManageMapper.addAgentArea(areaMap);
    }
    @RequestMapping(value = "/getAgentAreaByAgentId", method = RequestMethod.POST)
    Map<String,Object> getAgentAreaByAgentId(@RequestBody Map<String, Object> areaMap){
        return agentManageMapper.getAgentAreaByAgentId(areaMap);
    }
    @RequestMapping(value = "/updateAgentArea", method = RequestMethod.POST)
    int updateAgentArea(@RequestBody Map<String, Object> agentArea){
        return agentManageMapper.updateAgentArea(agentArea);
    }
    @RequestMapping(value = "/deleteAgentUserById", method = RequestMethod.POST)
    int deleteAgentUserById(@RequestParam("id") String id){
        return agentManageMapper.deleteAgentUserById(id);
    }
}
